<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>befory登陆</title>

    <link rel="shortcut icon" href="favicon.ico">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/font-awesome.min.css" rel="stylesheet">

    <link href="css/animate.min.css" rel="stylesheet">
    <link href="css/style.min.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">befory</h1>

            </div>
            <h3>欢迎使用 befory</h3>

            <form class="m-t" role="form" id="loginForm">
                <div class="form-group">
                    <input type="email" class="form-control" placeholder="用户名" required="" name="loginName">
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" placeholder="密码" required="" name="password">
                </div>
                <button id="loginBtn" type="button" class="btn btn-primary block full-width m-b">登 录</button>
                <!--<p class="text-muted text-center"> <a href="#"><small>忘记密码了？</small></a> | <a href="register.html">注册一个新账号</a>-->
                </p>

            </form>
        </div>
    </div>
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script>
        $(function () {
            $('#loginBtn').click(function () {
                $.post('/signIn',$('#loginForm').serialize(),function (res) {
                    if(res){
                        if(res.code == 200){
                            if(res.data && res.data.loginStatus){
                                var token = res.data.token;
                                sessionStorage.setItem("Token",token);
                                sessionStorage.setItem("uid",res.data.uid);
                                window.location.href = "/index";
                            }
                        }
                    }
                });
            });
        });
    </script>
</body>

</html>